package cn.tedu.shoot;
import java.awt.image.BufferedImage;

import javax.imageio.ImageIO;
//图片工具类
public class Images {
//	公开的     静态的   图片数据类型       变量名
	public static BufferedImage sky;
	public static BufferedImage bullet;
	public static BufferedImage hero;
	public static BufferedImage[]airs;
	public static BufferedImage[]bairs;
	public static BufferedImage[]bees;
	public static BufferedImage[] rfs;
	public static BufferedImage start;
	public static BufferedImage pause;
	public static BufferedImage gameover;
	public static BufferedImage boss;
	public static BufferedImage bossbullet;

	
	static {
		start=readImage("start1.png");
		pause=readImage("pause1.png");
		gameover=readImage("gameover.png");
		sky=readImage("background.jpg");
		bullet=readImage("bullet.jpg");
		hero=readImage("hero.png");
		boss=readImage("boss.png");
		bossbullet=readImage("bossbullet.png");
		airs=new BufferedImage[8];
		bairs=new BufferedImage[8];
		rfs = new BufferedImage[8];
		bees=new BufferedImage[8];
		airs[0]=readImage("airplane.png");
		bairs[0]=readImage("bigairplane.png");
		rfs[0] = readImage("randomfly.png");
		bees[0]=readImage("bee.png");
		for(int i=1;i<airs.length;i++) {
			airs[i]=readImage("b"+i+".png");
			bairs[i]=readImage("b"+i+".png");
			bees[i]=readImage("b"+i+".png");
			rfs[i] = readImage("b"+i+".png");
		}
	}
	//读取图片 fileName:图片名称
	public static BufferedImage readImage(String fileName){
		try{
			BufferedImage img = ImageIO.read(FlyingObject.class.getResource(fileName));
			return img;
		}catch(Exception e){
			e.printStackTrace();
			throw new RuntimeException();
		}
	}

}
